package com.fz.controller;

import com.fz.dao.BookDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by webrx on 2017-09-12.
 */
@Controller
public class Index {
    @Autowired
    protected BookDAO bdao;
    @RequestMapping("")
    public String i(Model m){
        m.addAttribute("books",bdao.queryAll());
        return "index";
    }
}
